package com.atguigu.gmall.item.vo;

import com.atguigu.gmall.pms.entity.CategoryEntity;
import com.atguigu.gmall.pms.entity.SkuImagesEntity;
import com.atguigu.gmall.pms.vo.ItemGroupVo;
import com.atguigu.gmall.pms.vo.SaleAttrValueVo;
import com.atguigu.gmall.sms.vo.ItemSaleVo;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Data
public class ItemVo {
    // 面包屑：一二三级分类
   private List<CategoryEntity> categories;
    // 面包屑：品牌信息
   private Long brandId;
   private String brandName;
    // 面包屑：spu信息
   private Long spuId;
   private String spuName;
    // sku相关信息
   private Long skuId;
   private String title;
   private String subTitle;
   private BigDecimal price;
   private Integer weight;
   private String defaultImage;
    // 商品营销信息sms_sku_bounds,sku_ladder,sku_full_reduction
   private List<ItemSaleVo> sales;
    // 是否有货wms_ware_sku
   private Boolean store=false;
    // 图片列表sku_images
   private List<SkuImagesEntity>images;

    // 销售属性列e表 ：pms_sku里的spuId->skuId->pms_sku_attr_value
    // [{attrId: 3, attrName: 颜色, attrValues: ['黑色', '白色']},
    // {attrId: 4, attrName: 内存, attrValues: ['8G', '12G']},
    // {attrId: 5, attrName: 存储, attrValues: ['128G', '256G', '512G']}]
   private List<SaleAttrValueVo>saleAttrs;

    // 当前商品的销售属性JSON格式字符串(高亮)：{3: '黑色', 4: '8G', 5: '128G'}
    //pms_sku_attr_value里的skuId->id,value
    private Map<Long,String> saleAttr;

    // 销售属性组合和skuId的映射关系 ：{'黑色,8G,128G': 10, '黑色,12G,256G': 11}
    //pms_sku_attr_value里的skuId与attr_value的映射
    private Map<String,Object>skuJsons;

    //spu的海报信息 商品描述pms_spu_desc
    private List<String> spuImages;

    //规格参数组及组下的规格参数(带值)
    //pms_sku里的category_id查pms_attr_group里的id,name,sort,icon
    // 再通过category_id和group_id查询pms_attr下的参数
    //再根据pms_attr下的type值的不同,type=1根据spu_id查询pms_spu_attr_value获得具体值,type=0根据sku_id查询pms_sku_attr_value获得具体值
    private List<ItemGroupVo>groups;
}
